Optimal. Leaf size=162 \[ \frac{15 A+i B}{16 a^4 d (1+i \tan (c+d x))}+\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}-\frac{x (-B+15 i A)}{16 a^4}+\frac{A \log (\sin (c+d x))}{a^4 d}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.494243, antiderivative size = 162, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.094, Rules used = {3596, 3531, 3475} \[ \frac{15 A+i B}{16 a^4 d (1+i \tan (c+d x))}+\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}-\frac{x (-B+15 i A)}{16 a^4}+\frac{A \log (\sin (c+d x))}{a^4 d}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3596
Rule 3531
Rule 3475
Rubi steps
\begin{align*} \int \frac{\cot (c+d x) (A+B \tan (c+d x))}{(a+i a \tan (c+d x))^4} \, dx &=\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{\int \frac{\cot (c+d x) (8 a A-4 a (i A-B) \tan (c+d x))}{(a+i a \tan (c+d x))^3} \, dx}{8 a^2}\\ &=\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{\int \frac{\cot (c+d x) \left (48 a^2 A-12 a^2 (3 i A-B) \tan (c+d x)\right )}{(a+i a \tan (c+d x))^2} \, dx}{48 a^4}\\ &=\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{\int \frac{\cot (c+d x) \left (192 a^3 A-24 a^3 (7 i A-B) \tan (c+d x)\right )}{a+i a \tan (c+d x)} \, dx}{192 a^6}\\ &=\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{15 A+i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{\int \cot (c+d x) \left (384 a^4 A-24 a^4 (15 i A-B) \tan (c+d x)\right ) \, dx}{384 a^8}\\ &=-\frac{(15 i A-B) x}{16 a^4}+\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{15 A+i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{A \int \cot (c+d x) \, dx}{a^4}\\ &=-\frac{(15 i A-B) x}{16 a^4}+\frac{A \log (\sin (c+d x))}{a^4 d}+\frac{7 A+i B}{16 a^4 d (1+i \tan (c+d x))^2}+\frac{A+i B}{8 d (a+i a \tan (c+d x))^4}+\frac{3 A+i B}{12 a d (a+i a \tan (c+d x))^3}+\frac{15 A+i B}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}
Mathematica [A] time = 1.12394, size = 193, normalized size = 1.19 \[ \frac{\sec ^4(c+d x) (16 (21 A+4 i B) \cos (2 (c+d x))+3 \cos (4 (c+d x)) (128 A \log (\sin (c+d x))-120 i A d x+A+8 B d x+i B)+288 i A \sin (2 (c+d x))+360 A d x \sin (4 (c+d x))-3 i A \sin (4 (c+d x))+384 i A \sin (4 (c+d x)) \log (\sin (c+d x))+96 A-32 B \sin (2 (c+d x))+3 B \sin (4 (c+d x))+24 i B d x \sin (4 (c+d x))+36 i B)}{384 a^4 d (\tan (c+d x)-i)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.122, size = 259, normalized size = 1.6 \begin{align*}{\frac{A}{8\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}+{\frac{{\frac{i}{8}}B}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) B}{{a}^{4}d}}-{\frac{31\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) A}{32\,{a}^{4}d}}-{\frac{{\frac{15\,i}{16}}A}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{B}{16\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{B}{12\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{{\frac{i}{4}}A}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}-{\frac{7\,A}{16\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{{\frac{i}{16}}B}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{A\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{32\,{a}^{4}d}}+{\frac{{\frac{i}{32}}B\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{4}d}}+{\frac{A\ln \left ( \tan \left ( dx+c \right ) \right ) }{{a}^{4}d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.53233, size = 362, normalized size = 2.23 \begin{align*} \frac{{\left ({\left (-744 i \, A + 24 \, B\right )} d x e^{\left (8 i \, d x + 8 i \, c\right )} + 384 \, A e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + 24 \,{\left (13 \, A + 2 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 12 \,{\left (8 \, A + 3 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 8 \,{\left (3 \, A + 2 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 3 \, A + 3 i \, B\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{384 \, a^{4} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 23.5548, size = 360, normalized size = 2.22 \begin{align*} \frac{A \log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a^{4} d} + \begin{cases} \frac{\left (\left (24576 A a^{12} d^{3} e^{12 i c} + 24576 i B a^{12} d^{3} e^{12 i c}\right ) e^{- 8 i d x} + \left (196608 A a^{12} d^{3} e^{14 i c} + 131072 i B a^{12} d^{3} e^{14 i c}\right ) e^{- 6 i d x} + \left (786432 A a^{12} d^{3} e^{16 i c} + 294912 i B a^{12} d^{3} e^{16 i c}\right ) e^{- 4 i d x} + \left (2555904 A a^{12} d^{3} e^{18 i c} + 393216 i B a^{12} d^{3} e^{18 i c}\right ) e^{- 2 i d x}\right ) e^{- 20 i c}}{3145728 a^{16} d^{4}} & \text{for}\: 3145728 a^{16} d^{4} e^{20 i c} \neq 0 \\x \left (\frac{31 i A - B}{16 a^{4}} - \frac{\left (31 i A e^{8 i c} + 26 i A e^{6 i c} + 16 i A e^{4 i c} + 6 i A e^{2 i c} + i A - B e^{8 i c} - 4 B e^{6 i c} - 6 B e^{4 i c} - 4 B e^{2 i c} - B\right ) e^{- 8 i c}}{16 a^{4}}\right ) & \text{otherwise} \end{cases} + \frac{x \left (- 31 i A + B\right )}{16 a^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34165, size = 224, normalized size = 1.38 \begin{align*} -\frac{\frac{12 \,{\left (A - i \, B\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{a^{4}} + \frac{12 \,{\left (31 \, A + i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a^{4}} - \frac{384 \, A \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{4}} - \frac{775 \, A \tan \left (d x + c\right )^{4} + 25 i \, B \tan \left (d x + c\right )^{4} - 3460 i \, A \tan \left (d x + c\right )^{3} + 124 \, B \tan \left (d x + c\right )^{3} - 5898 \, A \tan \left (d x + c\right )^{2} - 246 i \, B \tan \left (d x + c\right )^{2} + 4612 i \, A \tan \left (d x + c\right ) - 252 \, B \tan \left (d x + c\right ) + 1447 \, A + 153 i \, B}{a^{4}{\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{384 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]